﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace PlanningGIS.Entry
{
    public class SafeCheck
    {
        private bool isOK { get; set; }

        //初始化时检测环境
        public SafeCheck()
        {
            isOK = false;
            isOK = PiEnvCheck();
        }

        //判断是否有加密环境	
        public bool IsSafe()
        {
            return isOK;
        }

        //终止当前进程
        public bool KillProc()
        {
            return PiKillCurrentProcess();
        }

        [DllImport("PiEnvCheck.dll")]
        private static extern bool PiEnvCheck();
        [DllImport("PiEnvCheck.dll")]
        private static extern bool PiKillCurrentProcess();
    }
}
